3.1.65 \(\int \sec ^3(c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx\) [65]

3.1.65.1 Optimal result
3.1.65.2 Mathematica [C] (verified)
3.1.65.3 Rubi [A] (verified)
3.1.65.4 Maple [A] (verified)
3.1.65.5 Fricas [A] (verification not implemented)
3.1.65.6 Sympy [F]
3.1.65.7 Maxima [A] (verification not implemented)
3.1.65.8 Giac [A] (verification not implemented)
3.1.65.9 Mupad [B] (verification not implemented)

3.1.65.1 Optimal result

Integrand size = 28, antiderivative size = 72 \[ \int \sec ^3(c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=a \left (a^2-3 b^2\right ) x-\frac {b \left (3 a^2-b^2\right ) \log (\cos (c+d x))}{d}+\frac {2 a b^2 \tan (c+d x)}{d}+\frac {b (a+b \tan (c+d x))^2}{2 d} \]

output
a*(a^2-3*b^2)*x-b*(3*a^2-b^2)*ln(cos(d*x+c))/d+2*a*b^2*tan(d*x+c)/d+1/2*b* 
(a+b*tan(d*x+c))^2/d
 
3.1.65.2 Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.24 (sec) , antiderivative size = 79, normalized size of antiderivative = 1.10 \[ \int \sec ^3(c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\frac {(i a-b)^3 \log (i-\tan (c+d x))-(i a+b)^3 \log (i+\tan (c+d x))+6 a b^2 \tan (c+d x)+b^3 \tan ^2(c+d x)}{2 d} \]

input
Integrate[Sec[c + d*x]^3*(a*Cos[c + d*x] + b*Sin[c + d*x])^3,x]
 
output
((I*a - b)^3*Log[I - Tan[c + d*x]] - (I*a + b)^3*Log[I + Tan[c + d*x]] + 6 
*a*b^2*Tan[c + d*x] + b^3*Tan[c + d*x]^2)/(2*d)
 
3.1.65.3 Rubi [A] (verified)

Time = 0.44 (sec) , antiderivative size = 72, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3042, 3565, 3042, 3963, 3042, 4008, 3042, 3956}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \sec ^3(c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {(a \cos (c+d x)+b \sin (c+d x))^3}{\cos (c+d x)^3}dx\)

\(\Big \downarrow \) 3565

\(\displaystyle \int (a+b \tan (c+d x))^3dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int (a+b \tan (c+d x))^3dx\)

\(\Big \downarrow \) 3963

\(\displaystyle \int (a+b \tan (c+d x)) \left (a^2+2 b \tan (c+d x) a-b^2\right )dx+\frac {b (a+b \tan (c+d x))^2}{2 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \int (a+b \tan (c+d x)) \left (a^2+2 b \tan (c+d x) a-b^2\right )dx+\frac {b (a+b \tan (c+d x))^2}{2 d}\)

\(\Big \downarrow \) 4008

\(\displaystyle b \left (3 a^2-b^2\right ) \int \tan (c+d x)dx+a x \left (a^2-3 b^2\right )+\frac {2 a b^2 \tan (c+d x)}{d}+\frac {b (a+b \tan (c+d x))^2}{2 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle b \left (3 a^2-b^2\right ) \int \tan (c+d x)dx+a x \left (a^2-3 b^2\right )+\frac {2 a b^2 \tan (c+d x)}{d}+\frac {b (a+b \tan (c+d x))^2}{2 d}\)

\(\Big \downarrow \) 3956

\(\displaystyle -\frac {b \left (3 a^2-b^2\right ) \log (\cos (c+d x))}{d}+a x \left (a^2-3 b^2\right )+\frac {2 a b^2 \tan (c+d x)}{d}+\frac {b (a+b \tan (c+d x))^2}{2 d}\)

input
Int[Sec[c + d*x]^3*(a*Cos[c + d*x] + b*Sin[c + d*x])^3,x]
 
output
a*(a^2 - 3*b^2)*x - (b*(3*a^2 - b^2)*Log[Cos[c + d*x]])/d + (2*a*b^2*Tan[c 
 + d*x])/d + (b*(a + b*Tan[c + d*x])^2)/(2*d)
 

3.1.65.3.1 Defintions of rubi rules used

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3565
Int[cos[(c_.) + (d_.)*(x_)]^(m_)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin 
[(c_.) + (d_.)*(x_)])^(n_.), x_Symbol] :> Int[(a + b*Tan[c + d*x])^n, x] /; 
 FreeQ[{a, b, c, d}, x] && EqQ[m + n, 0] && IntegerQ[n] && NeQ[a^2 + b^2, 0 
]
 

rule 3956
Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d 
*x], x]]/d, x] /; FreeQ[{c, d}, x]
 

rule 3963
Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*((a + 
b*Tan[c + d*x])^(n - 1)/(d*(n - 1))), x] + Int[(a^2 - b^2 + 2*a*b*Tan[c + d 
*x])*(a + b*Tan[c + d*x])^(n - 2), x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 
+ b^2, 0] && GtQ[n, 1]
 

rule 4008
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.) 
*(x_)]), x_Symbol] :> Simp[(a*c - b*d)*x, x] + (Simp[b*d*(Tan[e + f*x]/f), 
x] + Simp[(b*c + a*d)   Int[Tan[e + f*x], x], x]) /; FreeQ[{a, b, c, d, e, 
f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]
 
3.1.65.4 Maple [A] (verified)

Time = 1.08 (sec) , antiderivative size = 70, normalized size of antiderivative = 0.97

method result size
derivativedivides \(\frac {a^{3} \left (d x +c \right )-3 a^{2} b \ln \left (\cos \left (d x +c \right )\right )+3 a \,b^{2} \left (\tan \left (d x +c \right )-d x -c \right )+b^{3} \left (\frac {\tan \left (d x +c \right )^{2}}{2}+\ln \left (\cos \left (d x +c \right )\right )\right )}{d}\) \(70\)
default \(\frac {a^{3} \left (d x +c \right )-3 a^{2} b \ln \left (\cos \left (d x +c \right )\right )+3 a \,b^{2} \left (\tan \left (d x +c \right )-d x -c \right )+b^{3} \left (\frac {\tan \left (d x +c \right )^{2}}{2}+\ln \left (\cos \left (d x +c \right )\right )\right )}{d}\) \(70\)
parts \(\frac {a^{3} \left (d x +c \right )}{d}+\frac {b^{3} \left (\frac {\tan \left (d x +c \right )^{2}}{2}+\ln \left (\cos \left (d x +c \right )\right )\right )}{d}+\frac {3 a \,b^{2} \left (\tan \left (d x +c \right )-d x -c \right )}{d}+\frac {3 a^{2} b \ln \left (\sec \left (d x +c \right )\right )}{d}\) \(78\)
risch \(3 i a^{2} b x -i x \,b^{3}+a^{3} x -3 a \,b^{2} x +\frac {6 i b \,a^{2} c}{d}-\frac {2 i b^{3} c}{d}+\frac {2 b^{2} \left (3 i a \,{\mathrm e}^{2 i \left (d x +c \right )}+b \,{\mathrm e}^{2 i \left (d x +c \right )}+3 i a \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}-\frac {3 b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) a^{2}}{d}+\frac {b^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) \(140\)
parallelrisch \(\frac {6 b \left (1+\cos \left (2 d x +2 c \right )\right ) \left (a^{2}-\frac {b^{2}}{3}\right ) \ln \left (\sec \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )-6 b \left (1+\cos \left (2 d x +2 c \right )\right ) \left (a^{2}-\frac {b^{2}}{3}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )-6 b \left (1+\cos \left (2 d x +2 c \right )\right ) \left (a^{2}-\frac {b^{2}}{3}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\left (2 a^{3} x d -6 a \,b^{2} d x -b^{3}\right ) \cos \left (2 d x +2 c \right )+2 a^{3} x d -6 a \,b^{2} d x +6 \sin \left (2 d x +2 c \right ) a \,b^{2}+b^{3}}{2 d \left (1+\cos \left (2 d x +2 c \right )\right )}\) \(189\)
norman \(\frac {\left (a^{3}-3 a \,b^{2}\right ) x +\left (-2 a^{3}+6 a \,b^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\left (-2 a^{3}+6 a \,b^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\left (a^{3}-3 a \,b^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\left (a^{3}-3 a \,b^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\left (a^{3}-3 a \,b^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}-\frac {2 b^{3}}{d}-\frac {2 b^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}}{d}+\frac {10 b^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{d}+\frac {10 b^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{d}+\frac {6 a \,b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {12 a \,b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{d}-\frac {12 a \,b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{d}-\frac {6 a \,b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{d}}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{2} \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{3}}+\frac {b \left (3 a^{2}-b^{2}\right ) \ln \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )}{d}-\frac {b \left (3 a^{2}-b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}-\frac {b \left (3 a^{2}-b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}\) \(396\)

input
int(sec(d*x+c)^3*(cos(d*x+c)*a+b*sin(d*x+c))^3,x,method=_RETURNVERBOSE)
 
output
1/d*(a^3*(d*x+c)-3*a^2*b*ln(cos(d*x+c))+3*a*b^2*(tan(d*x+c)-d*x-c)+b^3*(1/ 
2*tan(d*x+c)^2+ln(cos(d*x+c))))
 
3.1.65.5 Fricas [A] (verification not implemented)

Time = 0.26 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.22 \[ \int \sec ^3(c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\frac {2 \, {\left (a^{3} - 3 \, a b^{2}\right )} d x \cos \left (d x + c\right )^{2} + 6 \, a b^{2} \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 2 \, {\left (3 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )^{2} \log \left (-\cos \left (d x + c\right )\right ) + b^{3}}{2 \, d \cos \left (d x + c\right )^{2}} \]

input
integrate(sec(d*x+c)^3*(a*cos(d*x+c)+b*sin(d*x+c))^3,x, algorithm="fricas" 
)
 
output
1/2*(2*(a^3 - 3*a*b^2)*d*x*cos(d*x + c)^2 + 6*a*b^2*cos(d*x + c)*sin(d*x + 
 c) - 2*(3*a^2*b - b^3)*cos(d*x + c)^2*log(-cos(d*x + c)) + b^3)/(d*cos(d* 
x + c)^2)
 
3.1.65.6 Sympy [F]

\[ \int \sec ^3(c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\int \left (a \cos {\left (c + d x \right )} + b \sin {\left (c + d x \right )}\right )^{3} \sec ^{3}{\left (c + d x \right )}\, dx \]

input
integrate(sec(d*x+c)**3*(a*cos(d*x+c)+b*sin(d*x+c))**3,x)
 
output
Integral((a*cos(c + d*x) + b*sin(c + d*x))**3*sec(c + d*x)**3, x)
 
3.1.65.7 Maxima [A] (verification not implemented)

Time = 0.31 (sec) , antiderivative size = 85, normalized size of antiderivative = 1.18 \[ \int \sec ^3(c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\frac {2 \, {\left (d x + c\right )} a^{3} - 6 \, {\left (d x + c - \tan \left (d x + c\right )\right )} a b^{2} - b^{3} {\left (\frac {1}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right )^{2} - 1\right )\right )} - 3 \, a^{2} b \log \left (-\sin \left (d x + c\right )^{2} + 1\right )}{2 \, d} \]

input
integrate(sec(d*x+c)^3*(a*cos(d*x+c)+b*sin(d*x+c))^3,x, algorithm="maxima" 
)
 
output
1/2*(2*(d*x + c)*a^3 - 6*(d*x + c - tan(d*x + c))*a*b^2 - b^3*(1/(sin(d*x 
+ c)^2 - 1) - log(sin(d*x + c)^2 - 1)) - 3*a^2*b*log(-sin(d*x + c)^2 + 1)) 
/d
 
3.1.65.8 Giac [A] (verification not implemented)

Time = 0.35 (sec) , antiderivative size = 71, normalized size of antiderivative = 0.99 \[ \int \sec ^3(c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\frac {b^{3} \tan \left (d x + c\right )^{2} + 6 \, a b^{2} \tan \left (d x + c\right ) + 2 \, {\left (a^{3} - 3 \, a b^{2}\right )} {\left (d x + c\right )} + {\left (3 \, a^{2} b - b^{3}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{2 \, d} \]

input
integrate(sec(d*x+c)^3*(a*cos(d*x+c)+b*sin(d*x+c))^3,x, algorithm="giac")
 
output
1/2*(b^3*tan(d*x + c)^2 + 6*a*b^2*tan(d*x + c) + 2*(a^3 - 3*a*b^2)*(d*x + 
c) + (3*a^2*b - b^3)*log(tan(d*x + c)^2 + 1))/d
 
3.1.65.9 Mupad [B] (verification not implemented)

Time = 23.58 (sec) , antiderivative size = 183, normalized size of antiderivative = 2.54 \[ \int \sec ^3(c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\frac {2\,\left (\frac {b^3\,\ln \left (\frac {\cos \left (c+d\,x\right )}{\cos \left (c+d\,x\right )+1}\right )}{2}-\frac {b^3\,\ln \left (\frac {1}{{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}\right )}{2}+a^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )+\frac {3\,a^2\,b\,\ln \left (\frac {1}{{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}\right )}{2}-3\,a\,b^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )-\frac {3\,a^2\,b\,\ln \left (\frac {\cos \left (c+d\,x\right )}{\cos \left (c+d\,x\right )+1}\right )}{2}\right )}{d}+\frac {\frac {b^3}{2}+\frac {3\,a\,\sin \left (2\,c+2\,d\,x\right )\,b^2}{2}}{d\,\left (\frac {\cos \left (2\,c+2\,d\,x\right )}{2}+\frac {1}{2}\right )} \]

input
int((a*cos(c + d*x) + b*sin(c + d*x))^3/cos(c + d*x)^3,x)
 
output
(2*((b^3*log(cos(c + d*x)/(cos(c + d*x) + 1)))/2 - (b^3*log(1/cos(c/2 + (d 
*x)/2)^2))/2 + a^3*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)) + (3*a^2*b* 
log(1/cos(c/2 + (d*x)/2)^2))/2 - 3*a*b^2*atan(sin(c/2 + (d*x)/2)/cos(c/2 + 
 (d*x)/2)) - (3*a^2*b*log(cos(c + d*x)/(cos(c + d*x) + 1)))/2))/d + (b^3/2 
 + (3*a*b^2*sin(2*c + 2*d*x))/2)/(d*(cos(2*c + 2*d*x)/2 + 1/2))